package dominion.player;

import dominion.Dominion;
import dominion.kingdom.Bureaucrat;

public class OneBureaucratPlayer extends TresureOnlyPlayer {

	boolean buy = false;

	public OneBureaucratPlayer(Dominion dominion) {
		this("OneBureaucrat", dominion);
	}

	public OneBureaucratPlayer(String name, Dominion dominion) {
		super(name, dominion);
	}

	@Override
	public int buy(Dominion dominion, int value) {
		if (buy == false && 3 < value) {
			buy = true;
			if (dominion.buy(this, new Bureaucrat())) {
				value -= 4;
			}
		} else {
			value = super.buy(dominion, value);
		}
		return value;
	}
}
